<template>
	<card-box title="实验安排" goto="/schedule">
		<el-table :data="tableData" size="medium" height="410px" class="index_table_wrapper">
			<el-table-column type="index" label="序号" width="54" align="center"></el-table-column>
			<el-table-column label="开始时间" prop="startTime" min-width="110"></el-table-column>
			<el-table-column label="实验站名称" prop="expName" min-width="110"></el-table-column>
			<el-table-column label="实验PI" prop="headName" min-width="100"></el-table-column>
			<el-table-column label="液氦预约量" prop="filed1" width="100">
				<template slot-scope="{ row }">{{ row.filed1 }}升(L)</template>
			</el-table-column>
		</el-table>
	</card-box>
</template>

<script>
import moment from 'moment';
import { mapGetters } from 'vuex';
import cardBox from '@/views/common/cardBox';
import { queryDownPageList } from '@/api/business/tbPiStat';
export default {
	components: { cardBox },
	data() {
		return {
			tableData: []
		};
	},
	computed: { ...mapGetters(['userInfo']) },
	mounted() {
		this.getTableData();
	},
	methods: {
		//获取表格数据
		async getTableData() {
			let params = { page: 1, limit: 8, audit: '1', type: '1' };
			let result = await queryDownPageList(params).then((res) => res.data);
			this.loading = false;
			if (result.code === '0') {
				this.tableData = result.data || [];
			}
		},

		//时间段格式化
		timeRangeFormat(data) {
			let endTime = moment(data.endTime).format('YYYY-MM-DD');
			let startTime = moment(data.startTime).format('YYYY-MM-DD');
			return `${startTime} 至 ${endTime}`;
		}
	}
};
</script>

<style scoped></style>
